package com.itheima.reggie.common;

public class BaseContext  {
    //需要一个保存当前线程登录id的ThreadLocal
    //需要定义一个静态常量  静态--类名直接调用
    private static final ThreadLocal<Long> THREAD_LOCAL_USER_ID = new ThreadLocal<>();

    //   BaseContext.THREAD_LOCAL_USER_ID.set(...)
    //   BaseContext.THREAD_LOCAL_USER_ID.get()
    public static void setCurrentId(Long id){
        THREAD_LOCAL_USER_ID.set(id);

    }

    public static Long getCurrentId(){
        return THREAD_LOCAL_USER_ID.get();
    }
}
